Skip to content

Drop elabGPkgDescription from the elaborated plan - #12464

Open
PaleRoses wants to merge 1 commit into
haskell:masterfrom
PaleRoses:plan-cache-shared-descriptions
Open

PaleRoses wants to merge 1 commit into
haskell:masterfrom
PaleRoses:plan-cache-shared-descriptions

Conversation

@PaleRoses

@PaleRoses PaleRoses commented Oct 15, 2026 •

Copy link
Copy Markdown

Fixes #12463.

drops elabGPkgDescription; the in-library configure reads the .cabal file instead, as Setup does. unpacking already writes revisions there.

no-op cabal build all, one package with N public sublibraries; master 538d465, ghc 9.14.1, medians of three:

N improved-plan no-op
10 0.79 → 0.59 MB 0.08 → 0.07 s
40 7.5 → 4.4 MB 0.33 → 0.25 s
80 27.3 → 14.8 MB 1.04 → 0.65 s

QA Notes

build a package with internal libraries, and one from Hackage with a revision; both configure as before.

@PaleRoses
PaleRoses force-pushed the plan-cache-shared-descriptions branch from 6d57dc6 to 219ee89 Compare October 15, 2026 06:58
@sheaf
sheaf self-requested a review October 15, 2026 07:44
@sheaf

sheaf commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

This MR attempts to regain sharing after-the-fact during serialisation. I think that's papering over the issue in an incomplete and non-robust way.

As far as I understand, the regression was due to the addition of elabGPkgDescription to ElaboratedConfiguredPackage. So the fix should be to remove that field and find another way to thread that information through which avoids the duplication.

A similar win in this area is to stop elabPkgDescription being duplicated in every single unit of a package, which could be similarly achieved by removing it from the unit-specific data and shared, but that change is not strictly needed to address the regression.

@PaleRoses
PaleRoses force-pushed the plan-cache-shared-descriptions branch from 219ee89 to ab7be0d Compare October 15, 2026 10:07
Every unit carried its package's GenericPackageDescription, so the plan
caches grew with the square of a package's component count. The
in-library configure now reads it from the package's .cabal file, as a
Setup script does.

Fixes haskell#12463.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@PaleRoses
PaleRoses force-pushed the plan-cache-shared-descriptions branch from ab7be0d to a42643c Compare October 15, 2026 10:37
@PaleRoses PaleRoses changed the title Write each package's descriptions once in the plan caches Drop elabGPkgDescription from the elaborated plan Oct 15, 2026
@PaleRoses

Copy link
Copy Markdown
Author

done: dropped elabGPkgDescription, the in-library configure reads the .cabal file like Setup does. n=80 repro: improved-plan 27.3 → 14.8 MB. happy to do the same for elabPkgDescription in a follow-up.

@sheaf

sheaf commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Yes, much better approach, thanks. We will need to think through what it means for error messages for users, e.g. ensure that it doesn't cause duplicate error messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plan caches hold a copy of the package descriptions for every component

2 participants